package com.democxy.modules.cms.entity;

import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.democxy.common.baseData.BaseEntity;

/**
 * 博客信息Entity
 * @author democxy
 * @version 2020-03-11
 */
public class Blogs extends BaseEntity<Blogs> {
	
	private static final long serialVersionUID = 1L;
	private String id;
	private String title;		// 标题
	private String typeId;		// 博客类型
	private String blogLabels;		// 博客标签
	private String mainPic;		// 主图
	private String smallContent;		// 简介
	private String content;		// 内容
	private Integer lookNum;		// 浏览量
	private Date createTime;		// 发布时间
	
	public Blogs() {
		super();
	}

	public Blogs(String id){
		this.id = id;
	}
	
	public String getId() {
		return id;
	}


	public void setId(String id) {
		this.id = id;
	}
	

	@Length(min=1, max=200, message="标题长度必须介于 1 和 200 之间")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	@Length(min=1, max=40, message="博客类型长度必须介于 1 和 40 之间")
	public String getTypeId() {
		return typeId;
	}

	public void setTypeId(String typeId) {
		this.typeId = typeId;
	}
	
	@Length(min=1, max=100, message="博客标签长度必须介于 1 和 100 之间")
	public String getBlogLabels() {
		return blogLabels;
	}

	public void setBlogLabels(String blogLabels) {
		this.blogLabels = blogLabels;
	}
	
	@Length(min=0, max=100, message="主图长度必须介于 0 和 100 之间")
	public String getMainPic() {
		return mainPic;
	}

	public void setMainPic(String mainPic) {
		this.mainPic = mainPic;
	}
	
	public String getSmallContent() {
		return smallContent;
	}

	public void setSmallContent(String smallContent) {
		this.smallContent = smallContent;
	}
	
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	@NotNull(message="浏览量不能为空")
	public Integer getLookNum() {
		return lookNum;
	}

	public void setLookNum(Integer lookNum) {
		this.lookNum = lookNum;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="发布时间不能为空")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
}